//
// Created by YE on 2024/2/13.
//

#ifndef MATINTERPRETER_YCH_ERROR_H
#define MATINTERPRETER_YCH_ERROR_H
#include "ych_object.h"
#define YCH_ERROR_STACK_SIZE 16
typedef YCH_ERROR_STATE ECode;
typedef struct YError {
    ECode code;
    String info;
}Error;
typedef struct YErrorStack{
    int top;
    int capacity;
    Error* array;
}ErrorStack;
void initErrorStack(ErrorStack* stack);
int isEmptyErrorStack(ErrorStack* stack);
void pushErrorStack(ErrorStack* stack,Error error);
Error popErrorStack(ErrorStack* stack);
void freeErrorStack(ErrorStack* stack);
void deleteErrorStack(ErrorStack *stack);
#endif //MATINTERPRETER_YCH_ERROR_H
